FROM eclipse-temurin:21.0.5_11-jdk-jammy

LABEL author="baihongru"

# 时区设置
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' > /etc/timezone

ENV JAR_NAME=springboot-demo-openjdk21-0.0.1-SNAPSHOT.jar
ENV WORK_DIR=/home/app

RUN mkdir -p ${WORK_DIR}
COPY ./target/${JAR_NAME} ${WORK_DIR}

WORKDIR ${WORK_DIR}

ENTRYPOINT ["bash", "-c", "java ${JAVA_OPTS} -jar ${JAR_NAME}"]
